<template>
  <div class="HomeBanner">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item, index) in bannerList" :key="index">
        <img :src="item.imageUrl" class="banner-img" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { getBannerPic } from '@/Api/request.js'

export default {
  name: 'HomeBanner',
  data() {
    return {
      bannerList: {}
    }
  },
  mounted: async function () {
    const { data: res } = await getBannerPic()
    this.bannerList = res.banners
  },
  methods: {}
}
</script>

<style lang="less" scoped>
.my-swipe {
  width: 100%;
  height: 2.5rem;
  border-radius: 0.15rem;
}
.banner-img {
  width: 100%;
}
</style>